package com.fmsz.physicalheadline.entity.top;

import android.content.Intent;
import android.view.View;

import com.fmsz.physicalheadline.activitys.news.FocusImageActivity;
import com.fmsz.physicalheadline.activitys.news.FocusSecTypeActivity;

import java.util.Date;
import java.util.List;

/**
 * Created by Administrator on 2016/12/29.
 */

public class HeadEntity {
    private int code;
    private Data data;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public Data getData() {
        return data;
    }

    public void setData(Data data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "HeadEntity{" +
                "code=" + code +
                ", data=" + data +
                '}';
    }

    public class Data {
        private List<Heads> heads;

        public List<Heads> getHeads() {
            return heads;
        }

        public void setHeads(List<Heads> heads) {
            this.heads = heads;
        }

        @Override
        public String toString() {

            return "Data{" +
                    "heads=" + heads +
                    '}';
        }

        public class Heads {
            private String image;
            private String text;
            private String subtitle;
            private String link;
            private Date create_time;
            private int type;
            private Contest_Content contest_content;

            public int getType() {
                return type;
            }

            public void setType(int type) {
                this.type = type;
            }

            public String getImage() {
                return image;
            }

            public void setImage(String image) {
                this.image = image;
            }

            public String getText() {
                return text;
            }

            public void setText(String text) {
                this.text = text;
            }

            public String getSubtitle() {
                return subtitle;
            }

            public void setSubtitle(String subtitle) {
                this.subtitle = subtitle;
            }

            public Contest_Content getContest_content() {
                return contest_content;
            }

            public void setContest_content(Contest_Content contest_content) {
                this.contest_content = contest_content;
            }

            public String getLink() {
                return link;
            }

            public void setLink(String link) {
                this.link = link;
            }

            public Date getCreate_time() {
                return create_time;
            }

            public void setCreate_time(Date create_time) {
                this.create_time = create_time;
            }

            @Override
            public String toString() {
                return "Heads{" +
                        "image='" + image + '\'' +
                        ", text='" + text + '\'' +
                        ", subtitle='" + subtitle + '\'' +
                        ", contest_content=" + contest_content +
                        '}';
            }

            public class Contest_Content {
                private Contest contest;

                public Contest getContest() {
                    return contest;
                }

                public void setContest(Contest contest) {
                    this.contest = contest;
                }

                @Override
                public String toString() {
                    return "Contest_Content{" +
                            "contest=" + contest +
                            '}';
                }

                public class Contest {
                    private String home_scores;
                    private String away_scores;
                    private H_t h_t;
                    private A_t a_t;

                    public String getHome_scores() {
                        return home_scores;
                    }

                    public void setHome_scores(String home_scores) {
                        this.home_scores = home_scores;
                    }

                    public String getAway_scores() {
                        return away_scores;
                    }

                    public void setAway_scores(String away_scores) {
                        this.away_scores = away_scores;
                    }

                    public H_t getH_t() {
                        return h_t;
                    }

                    public void setH_t(H_t h_t) {
                        this.h_t = h_t;
                    }

                    public A_t getA_t() {
                        return a_t;
                    }

                    public void setA_t(A_t a_t) {
                        this.a_t = a_t;
                    }

                    @Override
                    public String toString() {
                        return "Contest{" +
                                "home_scores=" + home_scores +
                                ", away_scores=" + away_scores +
                                ", h_t=" + h_t +
                                ", a_t=" + a_t +
                                '}';
                    }

                    public class H_t {
                        private String name;
                        private String logo;

                        public String getLogo() {
                            return logo;
                        }

                        public void setLogo(String logo) {
                            this.logo = logo;
                        }

                        public String getName() {
                            return name;
                        }

                        public void setName(String name) {
                            this.name = name;
                        }

                        @Override
                        public String toString() {
                            return "H_t{" +
                                    "name='" + name + '\'' +
                                    ", logo='" + logo + '\'' +
                                    '}';
                        }
                    }

                    public class A_t {
                        private String name;
                        private String logo;

                        public String getName() {
                            return name;
                        }

                        public void setName(String name) {
                            this.name = name;
                        }

                        public String getLogo() {
                            return logo;
                        }

                        public void setLogo(String logo) {
                            this.logo = logo;
                        }

                        @Override
                        public String toString() {
                            return "A_t{" +
                                    "name='" + name + '\'' +
                                    ", logo='" + logo + '\'' +
                                    '}';
                        }
                    }
                }
            }

            public void click(View view) {
                Intent intent = new Intent();
                if (type == 4) {
                    intent.setClass(view.getContext(), FocusImageActivity.class);
                } else if (type == 2) {
                    intent.setClass(view.getContext(), FocusSecTypeActivity.class);
                }
                intent.putExtra("link", link);
                view.getContext().startActivity(intent);
            }

        }
    }
}
